package study.sharding.shardingjdbc.support.hint;

import org.apache.shardingsphere.api.hint.HintManager;

public class HintUtils {

    public static HintManager get() {
        return HintManager.getInstance();
    }

    /**
     *
     */
    public static void clear() {
        HintManager.clear();
    }

    /**
     * 走主库
     */
    public static void setMasterRouteOnly() {
        get().setMasterRouteOnly();
    }

    /**
     * 设置库分片值
     */
    public static void setDbShardingValue(final Comparable<?> value) {
        get().setDatabaseShardingValue(value);
    }

    /**
     * 设置库分片值
     */
    public void addDBShardingValue(final String logicTable, final Comparable<?> value) {
        get().addDatabaseShardingValue(logicTable, value);
    }

    /**
     * 设置表分片值
     */
    public void addTableShardingValue(final String logicTable, final Comparable<?> value) {
        get().addTableShardingValue(logicTable, value);
    }
}
